package exception_3_11;

public class Test {
    public static void main(String[] args) {

        String filename = "test.txt";
        System.out.println(filename.endsWith(".txt"));
        int[] arr = new int[]{1,2,3};

        try{
            //arr[3] = 10;
            arr = null;
            arr[0] = 100;
            System.out.println(10/0);
        }catch(ArithmeticException e){
            e.printStackTrace();
        }catch(NullPointerException e){
            System.out.println(e.getMessage());
            e.printStackTrace();
            System.out.println(e);
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println(e);
        }finally {
            System.out.println("finally 代码块");
        }

        System.out.println("异常捕获之后的代码块");
    }
}
